<%-- 
    Document   : signList
    Created on : Aug 23, 2012, 2:12:13 PM
    Author     : phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <f:view>
            <a href="freeLab.jsp">Free Lab</a>&nbsp;|&nbsp;
            <a href="mySignList.jsp">My Sign</a>&nbsp;|&nbsp;
            <a href="report.jsp">Send Report</a>&nbsp;|&nbsp;
            <a href="myReportList.jsp">My Report</a>
            <h1>My Sign List</h1>  
            <h:form id="signList">  
                Use Date: <h:inputText  value="#{signListBean.useDate}"/>
                <h:selectOneMenu value="#{signListBean.status}">
                    <f:selectItem  itemLabel="All" itemValue="All"></f:selectItem>
                    <f:selectItem  itemLabel="Request" itemValue="Request"></f:selectItem>
                    <f:selectItem  itemLabel="Deny" itemValue="Deny"></f:selectItem>
                    <f:selectItem  itemLabel="Approve" itemValue="Approve"></f:selectItem>
                    <f:selectItem  itemLabel="Done" itemValue="Done"></f:selectItem>
                </h:selectOneMenu>                
                <h:commandButton value="Search" action="search"/>         
                <h:dataTable var="sign" value="#{signListBean.signLabByUser}" border="1" >
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Id"/>
                        </f:facet>
                        <h:outputText value="#{sign.id}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Lab ID"/>
                        </f:facet>
                        <h:commandLink value="#{sign.lab.id}" action="labInfo" 
                                       actionListener="#{labBean.getLabByID(sign.lab.id)}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Create Date"/>
                        </f:facet>
                        <h:outputText value="#{sign.createDate}">
                            <f:convertDateTime pattern="HH:mm MM/dd/yyyy" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Time Table"/>
                        </f:facet>
                        <h:outputText value="#{sign.timeTable.id}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Use Date"/>
                        </f:facet>
                        <h:outputText value="#{sign.useDate}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Status"/>
                        </f:facet>
                        <h:outputText value="#{sign.status}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
        </f:view>
    </body>
</html>
